3.126 \(\int \frac{x^2 (c+d x^2+e x^4+f x^6)}{(a+b x^2)^2} \, dx\)

Optimal. Leaf size=163 \[ \frac{x^3 \left (c-\frac{a \left (a^2 f-a b e+b^2 d\right )}{b^3}\right )}{2 a \left (a+b x^2\right )}-\frac{x \left (5 a^2 b e-7 a^3 f-3 a b^2 d+b^3 c\right )}{2 a b^4}+\frac{\tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (5 a^2 b e-7 a^3 f-3 a b^2 d+b^3 c\right )}{2 \sqrt{a} b^{9/2}}+\frac{x^3 (b e-2 a f)}{3 b^3}+\frac{f x^5}{5 b^2} \]

[Out]

-((b^3*c - 3*a*b^2*d + 5*a^2*b*e - 7*a^3*f)*x)/(2*a*b^4) + ((b*e - 2*a*f)*x^3)/(3*b^3) + (f*x^5)/(5*b^2) + ((c
 - (a*(b^2*d - a*b*e + a^2*f))/b^3)*x^3)/(2*a*(a + b*x^2)) + ((b^3*c - 3*a*b^2*d + 5*a^2*b*e - 7*a^3*f)*ArcTan
[(Sqrt[b]*x)/Sqrt[a]])/(2*Sqrt[a]*b^(9/2))

________________________________________________________________________________________

Rubi [A]  time = 0.228794, antiderivative size = 163, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 30, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.133, Rules used = {1804, 1585, 1261, 205} \[ \frac{x^3 \left (c-\frac{a \left (a^2 f-a b e+b^2 d\right )}{b^3}\right )}{2 a \left (a+b x^2\right )}-\frac{x \left (5 a^2 b e-7 a^3 f-3 a b^2 d+b^3 c\right )}{2 a b^4}+\frac{\tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (5 a^2 b e-7 a^3 f-3 a b^2 d+b^3 c\right )}{2 \sqrt{a} b^{9/2}}+\frac{x^3 (b e-2 a f)}{3 b^3}+\frac{f x^5}{5 b^2} \]

Antiderivative was successfully verified.

[In]

Int[(x^2*(c + d*x^2 + e*x^4 + f*x^6))/(a + b*x^2)^2,x]

[Out]

-((b^3*c - 3*a*b^2*d + 5*a^2*b*e - 7*a^3*f)*x)/(2*a*b^4) + ((b*e - 2*a*f)*x^3)/(3*b^3) + (f*x^5)/(5*b^2) + ((c
 - (a*(b^2*d - a*b*e + a^2*f))/b^3)*x^3)/(2*a*(a + b*x^2)) + ((b^3*c - 3*a*b^2*d + 5*a^2*b*e - 7*a^3*f)*ArcTan
[(Sqrt[b]*x)/Sqrt[a]])/(2*Sqrt[a]*b^(9/2))

Rule 1804

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x
^2, x], f = Coeff[PolynomialRemainder[Pq, a + b*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b*x^2, x
], x, 1]}, Simp[((c*x)^m*(a + b*x^2)^(p + 1)*(a*g - b*f*x))/(2*a*b*(p + 1)), x] + Dist[c/(2*a*b*(p + 1)), Int[
(c*x)^(m - 1)*(a + b*x^2)^(p + 1)*ExpandToSum[2*a*b*(p + 1)*x*Q - a*g*m + b*f*(m + 2*p + 3)*x, x], x], x]] /;
FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && LtQ[p, -1] && GtQ[m, 0]

Rule 1585

Int[(u_.)*(x_)^(m_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.) + (c_.)*(x_)^(r_.))^(n_.), x_Symbol] :> Int[u*x^(m +
 n*p)*(a + b*x^(q - p) + c*x^(r - p))^n, x] /; FreeQ[{a, b, c, m, p, q, r}, x] && IntegerQ[n] && PosQ[q - p] &
& PosQ[r - p]

Rule 1261

Int[((f_.)*(x_))^(m_.)*((d_) + (e_.)*(x_)^2)^(q_.)*((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(p_.), x_Symbol] :> In
t[ExpandIntegrand[(f*x)^m*(d + e*x^2)^q*(a + b*x^2 + c*x^4)^p, x], x] /; FreeQ[{a, b, c, d, e, f, m, q}, x] &&
 NeQ[b^2 - 4*a*c, 0] && IGtQ[p, 0] && IGtQ[q, -2]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rubi steps

\begin{align*} \int \frac{x^2 \left (c+d x^2+e x^4+f x^6\right )}{\left (a+b x^2\right )^2} \, dx &=\frac{\left (c-\frac{a \left (b^2 d-a b e+a^2 f\right )}{b^3}\right ) x^3}{2 a \left (a+b x^2\right )}-\frac{\int \frac{x \left (\left (b c-3 a d+\frac{3 a^2 e}{b}-\frac{3 a^3 f}{b^2}\right ) x-2 a \left (e-\frac{a f}{b}\right ) x^3-2 a f x^5\right )}{a+b x^2} \, dx}{2 a b}\\ &=\frac{\left (c-\frac{a \left (b^2 d-a b e+a^2 f\right )}{b^3}\right ) x^3}{2 a \left (a+b x^2\right )}-\frac{\int \frac{x^2 \left (b c-3 a d+\frac{3 a^2 e}{b}-\frac{3 a^3 f}{b^2}-2 a \left (e-\frac{a f}{b}\right ) x^2-2 a f x^4\right )}{a+b x^2} \, dx}{2 a b}\\ &=\frac{\left (c-\frac{a \left (b^2 d-a b e+a^2 f\right )}{b^3}\right ) x^3}{2 a \left (a+b x^2\right )}-\frac{\int \left (c-\frac{a \left (3 b^2 d-5 a b e+7 a^2 f\right )}{b^3}-\frac{2 a (b e-2 a f) x^2}{b^2}-\frac{2 a f x^4}{b}+\frac{-a b^3 c+3 a^2 b^2 d-5 a^3 b e+7 a^4 f}{b^3 \left (a+b x^2\right )}\right ) \, dx}{2 a b}\\ &=-\frac{\left (b^3 c-3 a b^2 d+5 a^2 b e-7 a^3 f\right ) x}{2 a b^4}+\frac{(b e-2 a f) x^3}{3 b^3}+\frac{f x^5}{5 b^2}+\frac{\left (c-\frac{a \left (b^2 d-a b e+a^2 f\right )}{b^3}\right ) x^3}{2 a \left (a+b x^2\right )}+\frac{\left (b^3 c-3 a b^2 d+5 a^2 b e-7 a^3 f\right ) \int \frac{1}{a+b x^2} \, dx}{2 b^4}\\ &=-\frac{\left (b^3 c-3 a b^2 d+5 a^2 b e-7 a^3 f\right ) x}{2 a b^4}+\frac{(b e-2 a f) x^3}{3 b^3}+\frac{f x^5}{5 b^2}+\frac{\left (c-\frac{a \left (b^2 d-a b e+a^2 f\right )}{b^3}\right ) x^3}{2 a \left (a+b x^2\right )}+\frac{\left (b^3 c-3 a b^2 d+5 a^2 b e-7 a^3 f\right ) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{2 \sqrt{a} b^{9/2}}\\ \end{align*}

Mathematica [A]  time = 0.0817565, size = 148, normalized size = 0.91 \[ -\frac{x \left (a^2 b e+a^3 (-f)-a b^2 d+b^3 c\right )}{2 b^4 \left (a+b x^2\right )}-\frac{\tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right ) \left (-5 a^2 b e+7 a^3 f+3 a b^2 d-b^3 c\right )}{2 \sqrt{a} b^{9/2}}+\frac{x \left (3 a^2 f-2 a b e+b^2 d\right )}{b^4}+\frac{x^3 (b e-2 a f)}{3 b^3}+\frac{f x^5}{5 b^2} \]

Antiderivative was successfully verified.

[In]

Integrate[(x^2*(c + d*x^2 + e*x^4 + f*x^6))/(a + b*x^2)^2,x]

[Out]

((b^2*d - 2*a*b*e + 3*a^2*f)*x)/b^4 + ((b*e - 2*a*f)*x^3)/(3*b^3) + (f*x^5)/(5*b^2) - ((b^3*c - a*b^2*d + a^2*
b*e - a^3*f)*x)/(2*b^4*(a + b*x^2)) - ((-(b^3*c) + 3*a*b^2*d - 5*a^2*b*e + 7*a^3*f)*ArcTan[(Sqrt[b]*x)/Sqrt[a]
])/(2*Sqrt[a]*b^(9/2))

________________________________________________________________________________________

Maple [A]  time = 0.009, size = 212, normalized size = 1.3 \begin{align*}{\frac{f{x}^{5}}{5\,{b}^{2}}}-{\frac{2\,a{x}^{3}f}{3\,{b}^{3}}}+{\frac{{x}^{3}e}{3\,{b}^{2}}}+3\,{\frac{{a}^{2}fx}{{b}^{4}}}-2\,{\frac{aex}{{b}^{3}}}+{\frac{dx}{{b}^{2}}}+{\frac{x{a}^{3}f}{2\,{b}^{4} \left ( b{x}^{2}+a \right ) }}-{\frac{{a}^{2}xe}{2\,{b}^{3} \left ( b{x}^{2}+a \right ) }}+{\frac{axd}{2\,{b}^{2} \left ( b{x}^{2}+a \right ) }}-{\frac{cx}{2\,b \left ( b{x}^{2}+a \right ) }}-{\frac{7\,{a}^{3}f}{2\,{b}^{4}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{5\,{a}^{2}e}{2\,{b}^{3}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}-{\frac{3\,ad}{2\,{b}^{2}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{c}{2\,b}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a)^2,x)

[Out]

1/5*f*x^5/b^2-2/3/b^3*x^3*a*f+1/3/b^2*x^3*e+3/b^4*a^2*f*x-2/b^3*a*e*x+1/b^2*d*x+1/2/b^4*x/(b*x^2+a)*a^3*f-1/2/
b^3*x/(b*x^2+a)*a^2*e+1/2/b^2*x/(b*x^2+a)*a*d-1/2/b*x/(b*x^2+a)*c-7/2/b^4/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*
a^3*f+5/2/b^3/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*a^2*e-3/2/b^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*a*d+1/2/b/
(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*c

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.49616, size = 902, normalized size = 5.53 \begin{align*} \left [\frac{12 \, a b^{4} f x^{7} + 4 \,{\left (5 \, a b^{4} e - 7 \, a^{2} b^{3} f\right )} x^{5} + 20 \,{\left (3 \, a b^{4} d - 5 \, a^{2} b^{3} e + 7 \, a^{3} b^{2} f\right )} x^{3} + 15 \,{\left (a b^{3} c - 3 \, a^{2} b^{2} d + 5 \, a^{3} b e - 7 \, a^{4} f +{\left (b^{4} c - 3 \, a b^{3} d + 5 \, a^{2} b^{2} e - 7 \, a^{3} b f\right )} x^{2}\right )} \sqrt{-a b} \log \left (\frac{b x^{2} + 2 \, \sqrt{-a b} x - a}{b x^{2} + a}\right ) - 30 \,{\left (a b^{4} c - 3 \, a^{2} b^{3} d + 5 \, a^{3} b^{2} e - 7 \, a^{4} b f\right )} x}{60 \,{\left (a b^{6} x^{2} + a^{2} b^{5}\right )}}, \frac{6 \, a b^{4} f x^{7} + 2 \,{\left (5 \, a b^{4} e - 7 \, a^{2} b^{3} f\right )} x^{5} + 10 \,{\left (3 \, a b^{4} d - 5 \, a^{2} b^{3} e + 7 \, a^{3} b^{2} f\right )} x^{3} + 15 \,{\left (a b^{3} c - 3 \, a^{2} b^{2} d + 5 \, a^{3} b e - 7 \, a^{4} f +{\left (b^{4} c - 3 \, a b^{3} d + 5 \, a^{2} b^{2} e - 7 \, a^{3} b f\right )} x^{2}\right )} \sqrt{a b} \arctan \left (\frac{\sqrt{a b} x}{a}\right ) - 15 \,{\left (a b^{4} c - 3 \, a^{2} b^{3} d + 5 \, a^{3} b^{2} e - 7 \, a^{4} b f\right )} x}{30 \,{\left (a b^{6} x^{2} + a^{2} b^{5}\right )}}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a)^2,x, algorithm="fricas")

[Out]

[1/60*(12*a*b^4*f*x^7 + 4*(5*a*b^4*e - 7*a^2*b^3*f)*x^5 + 20*(3*a*b^4*d - 5*a^2*b^3*e + 7*a^3*b^2*f)*x^3 + 15*
(a*b^3*c - 3*a^2*b^2*d + 5*a^3*b*e - 7*a^4*f + (b^4*c - 3*a*b^3*d + 5*a^2*b^2*e - 7*a^3*b*f)*x^2)*sqrt(-a*b)*l
og((b*x^2 + 2*sqrt(-a*b)*x - a)/(b*x^2 + a)) - 30*(a*b^4*c - 3*a^2*b^3*d + 5*a^3*b^2*e - 7*a^4*b*f)*x)/(a*b^6*
x^2 + a^2*b^5), 1/30*(6*a*b^4*f*x^7 + 2*(5*a*b^4*e - 7*a^2*b^3*f)*x^5 + 10*(3*a*b^4*d - 5*a^2*b^3*e + 7*a^3*b^
2*f)*x^3 + 15*(a*b^3*c - 3*a^2*b^2*d + 5*a^3*b*e - 7*a^4*f + (b^4*c - 3*a*b^3*d + 5*a^2*b^2*e - 7*a^3*b*f)*x^2
)*sqrt(a*b)*arctan(sqrt(a*b)*x/a) - 15*(a*b^4*c - 3*a^2*b^3*d + 5*a^3*b^2*e - 7*a^4*b*f)*x)/(a*b^6*x^2 + a^2*b
^5)]

________________________________________________________________________________________

Sympy [A]  time = 2.43083, size = 216, normalized size = 1.33 \begin{align*} \frac{x \left (a^{3} f - a^{2} b e + a b^{2} d - b^{3} c\right )}{2 a b^{4} + 2 b^{5} x^{2}} + \frac{\sqrt{- \frac{1}{a b^{9}}} \left (7 a^{3} f - 5 a^{2} b e + 3 a b^{2} d - b^{3} c\right ) \log{\left (- a b^{4} \sqrt{- \frac{1}{a b^{9}}} + x \right )}}{4} - \frac{\sqrt{- \frac{1}{a b^{9}}} \left (7 a^{3} f - 5 a^{2} b e + 3 a b^{2} d - b^{3} c\right ) \log{\left (a b^{4} \sqrt{- \frac{1}{a b^{9}}} + x \right )}}{4} + \frac{f x^{5}}{5 b^{2}} - \frac{x^{3} \left (2 a f - b e\right )}{3 b^{3}} + \frac{x \left (3 a^{2} f - 2 a b e + b^{2} d\right )}{b^{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*(f*x**6+e*x**4+d*x**2+c)/(b*x**2+a)**2,x)

[Out]

x*(a**3*f - a**2*b*e + a*b**2*d - b**3*c)/(2*a*b**4 + 2*b**5*x**2) + sqrt(-1/(a*b**9))*(7*a**3*f - 5*a**2*b*e
+ 3*a*b**2*d - b**3*c)*log(-a*b**4*sqrt(-1/(a*b**9)) + x)/4 - sqrt(-1/(a*b**9))*(7*a**3*f - 5*a**2*b*e + 3*a*b
**2*d - b**3*c)*log(a*b**4*sqrt(-1/(a*b**9)) + x)/4 + f*x**5/(5*b**2) - x**3*(2*a*f - b*e)/(3*b**3) + x*(3*a**
2*f - 2*a*b*e + b**2*d)/b**4

________________________________________________________________________________________

Giac [A]  time = 1.16362, size = 205, normalized size = 1.26 \begin{align*} \frac{{\left (b^{3} c - 3 \, a b^{2} d - 7 \, a^{3} f + 5 \, a^{2} b e\right )} \arctan \left (\frac{b x}{\sqrt{a b}}\right )}{2 \, \sqrt{a b} b^{4}} - \frac{b^{3} c x - a b^{2} d x - a^{3} f x + a^{2} b x e}{2 \,{\left (b x^{2} + a\right )} b^{4}} + \frac{3 \, b^{8} f x^{5} - 10 \, a b^{7} f x^{3} + 5 \, b^{8} x^{3} e + 15 \, b^{8} d x + 45 \, a^{2} b^{6} f x - 30 \, a b^{7} x e}{15 \, b^{10}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*(f*x^6+e*x^4+d*x^2+c)/(b*x^2+a)^2,x, algorithm="giac")

[Out]

1/2*(b^3*c - 3*a*b^2*d - 7*a^3*f + 5*a^2*b*e)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b^4) - 1/2*(b^3*c*x - a*b^2*d*x
 - a^3*f*x + a^2*b*x*e)/((b*x^2 + a)*b^4) + 1/15*(3*b^8*f*x^5 - 10*a*b^7*f*x^3 + 5*b^8*x^3*e + 15*b^8*d*x + 45
*a^2*b^6*f*x - 30*a*b^7*x*e)/b^10